package com.witsight.cassandra.config;

import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.cassandra.core.CassandraAdminOperations;
import org.springframework.data.cassandra.core.CassandraTemplate;
import org.springframework.data.cassandra.repository.config.EnableCassandraRepositories;

import com.datastax.driver.core.Cluster;
import com.witsight.cassandra.dao.CustomCassandraRepositoryFactoryBean;

/**   
 * 说明：Cassandra数据库连接自动配置
 * @Title: CassandraDaoConfiguration.java 
 * @Package com.witsight.cassandra.config 
 * @See: {@link CassandraTemplate}
 * Copyright: Copyright (c) 2017
 * Company:sany huax witsight team by product
 * @author: penght  
 * @date: 2017年9月20日 上午11:09:48 
 * @version: V1.0
 *
 */
@Configuration
@ConditionalOnClass({ Cluster.class, CassandraAdminOperations.class })
@EnableConfigurationProperties({ CassandraProperties.class})
@EnableCassandraRepositories(repositoryFactoryBeanClass= CustomCassandraRepositoryFactoryBean.class, 
	basePackages= {"com.**.dao.**"}, cassandraTemplateRef="pageCassandraTemplate")
@AutoConfigureAfter(CassandraAutoConfiguration.class)
public class CassandraDaoConfiguration {
	
}
